<?php

// $name = "xuebingsi";

// echo $name;
// setcookie(key,value,exp,path);

// setcookie("id",99999,strtotime("+7 days"),'/');

// $user = ['username'=>'xuebingsi','age'=>18];

// setcookie('user',json_encode($user));
// 
// 




session_start();

$_SESSION['name']= "xuebingsi";

$_SESSION['id'] = "345345345";

$_SESSION['user'] = ['name'=>'bingsi','age'=>12];
//设置session过期时间
setcookie(session_name(),session_id(),time()+86400);